﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.LogEntries.OverruleInfluenceLogEntry
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using System.Collections.Generic;
using TaleWorlds.Core;
using TaleWorlds.Localization;
using TaleWorlds.SaveSystem;

#nullable disable
namespace TaleWorlds.CampaignSystem.LogEntries
{
  public class OverruleInfluenceLogEntry : LogEntry
  {
    [SaveableField(260)]
    private readonly Hero _liege;

    internal static void AutoGeneratedStaticCollectObjectsOverruleInfluenceLogEntry(
      object o,
      List<object> collectedObjects)
    {
      ((LogEntry) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      base.AutoGeneratedInstanceCollectObjects(collectedObjects);
      collectedObjects.Add((object) this._liege);
    }

    internal static object AutoGeneratedGetMemberValue_liege(object o)
    {
      return (object) ((OverruleInfluenceLogEntry) o)._liege;
    }

    public override CampaignTime KeepInHistoryTime => CampaignTime.Weeks(240f);

    public OverruleInfluenceLogEntry(Hero liege, Hero wrongedLord) => this._liege = liege;

    public override TextObject GetHistoricComment(Hero talkTroop)
    {
      TextObject text = GameTexts.FindText("str_overrule_influence_historic_comment");
      text.SetTextVariable("HERO", this._liege.Name);
      text.SetTextVariable("FACTION", this._liege.Clan.Name);
      return text;
    }

    public override int GetValueAsPoliticsAbuseOfPower(Hero referenceTroop, Hero liege)
    {
      return liege == this._liege ? 3 : 0;
    }

    public override string ToString() => nameof (OverruleInfluenceLogEntry);
  }
}
